package com.baibei.ebec.user.login;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.baibei.basic.IPresenter;
import com.baibei.ebec.user.R;
import com.baibei.ebec.user.R2;
import com.baibei.module.AppRouter;
import com.baibei.module.BasicFragmentActivity;

import butterknife.OnClick;

/**
 * 登录
 * Created by ChenRui on 2017/5/3 0003 11:41.
 */
@Route(path = AppRouter.ROUTER_USER_LOGIN)
public class LoginActivity extends BasicFragmentActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setNavigationIcon(R.drawable.ic_closed);
    }

    @Override
    protected Fragment onCreateFragment() {
        return LoginFragment.newInstance();
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    public IPresenter getBasicPresenter() {
        return null;
    }

    @OnClick(R2.id.btn_register)
    public void onRegisterClick() {
        AppRouter.routeToRegister(this);
    }

    @Override
    protected void onActivityResultOK(int requestCode, Intent data) {
        super.onActivityResultOK(requestCode, data);
        finish();
    }
}
